package sample.plugin.setting;

import android.content.Intent;
import android.view.View;

import com.rapid.api.component.page.setting.SettingsPage;
import com.rapid.api.component.widget.item.ISettingGroupView;
import com.rapid.api.framework.common.setting.AsSubSettingsInfo;
import com.rapid.api.framework.common.setting.BaseSettingsBuilder;

public class MySettingManager extends BaseSettingsBuilder {

    @Override
    public String getParentId() {
        return ID_ROOT;
    }

    @Override
    public String getId() {
        return "test";
    }

    @Override
    public AsSubSettingsInfo getAsSubSettingsInfo() {
        return null;
    }

    @Override
    public void build(SettingsPage settingsPage) {
        ISettingGroupView item1 = settingsPage.getOrAddSettingGroup("标题一");
        item1.addSwitchItem("标题", "描述", "itemKey1", true);
        item1.addSwitchItem("标题2", "描述2", "itemKey2", false);
        item1.addArrowItem("标题3", "描述3", new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });

        ISettingGroupView item2 = settingsPage.getOrAddSettingGroup("标题二");
        item2.addSwitchItem("标题", "描述", "itemKey1", true);
        item2.addSwitchItem("标题2", "描述2", "itemKey2", false);
        item2.addArrowItem("标题3", "描述3", new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
    }

    @Override
    public void onActivityResult(int i, int i1, Intent intent) {

    }

    @Override
    public void dispose() {

    }
}
